\<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/admin/common/inc/incSession.jsp" %>
<jsp:include page="/admin/common/inc/Top.jsp" />
<script>

var mDCal;
var toDay;
$(document).ready(function() {
	
	toDay = toTimeString(new Date());
	
	dhtmlx.skin = "";
	    mDCal = new dhtmlxDblCalendarObject('dhtmlxDblCalendar', false, {
	        isMonthEditable: true,
	        isYearEditable: true
	    });
	    mDCal.leftCalendar.setOnClickHandler(setStdt);
	    mDCal.rightCalendar.setOnClickHandler(setEndt);
	    mDCal.setYearsRange(2000, 2200);
	    mDCal.setDateFormat("%d/%m/%Y");
	    mDCal.setDate(toDay, toDay);
	    mDCal.draw();
	    dhtmlx.skin = "dhx_skyblue";
	    
	    
    function setStdt(date){
   		$('#srchStdt').val(toTimeString(date));
    }
    
    function setEndt(date){
   		$('#srchEndt').val(toTimeString(date));
    }
    
    function toTimeString(date) { //formatTime(date)
        var year  = date.getFullYear();
        var month = date.getMonth() + 1; // 1월=0,12월=11이므로 1 더함
        var day   = date.getDate();
        var hour  = date.getHours();
        var min   = date.getMinutes();

        if (("" + month).length == 1) { month = "0" + month; }
        if (("" + day).length   == 1) { day   = "0" + day;   }
        if (("" + hour).length  == 1) { hour  = "0" + hour;  }
        if (("" + min).length   == 1) { min   = "0" + min;   }

        return ("" + year + month + day);
    }
	    
	$('#calToggle').bind('click', function(event){
		
		if( mDCal.isVisible() ){
			$('#dhtmlxDblCalendar').fadeOut();
		} else {
			$('#dhtmlxDblCalendar').fadeIn();
		};
	});
	
	$('#dhtmlxDblCalendar').bind('click', function(event){
		
	});
	    
	
});
</script>
 
 
  <table>
  <tr>
<td colspan="2"><img name="calToggle" id="calToggle" src ="/common/calendar/imgs/icon_minicalendar.gif" /><div id="dhtmlxDblCalendar"></div></td>
  </tr>
</table>
<br>
<input type="text" name="srchStdt" id="srchStdt" />
<input type="text" name="srchEndt" id="srchEndt" />
<!-- topmenu -->
<jsp:include page="/admin/common/inc/TopMenu.jsp" />
<!-- //topmenu -->

</html>